<template>
	<div class="assetProtection">
		<div class="title">电催记录</div>
		<div v-for="(val , index) in electricRecordingList">
			<div class="info-subtitle">记录{{index+1}}</div>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					催收人：
					<label class="text">{{val.name}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					催收日期：
					<label class="text">{{val.date}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row resultShrink">
				<el-col class="subtitle" :span="3">催收记录</el-col>
				<el-col :span="12" class="text-height text-height-shrink" :id="'electricRecording'+index">
					{{ val.desc }}
				</el-col>
				<el-col :span="3">
					<el-button class="credit-button-text" type="text" @click="$libs.changeHeight('electricRecording'+index, val)">{{ val.shrinkText}}</el-button>
				</el-col>
			</el-row>
		</div>
		<div class="title">上门催收记录</div>
		<div v-for="(val , index) in doorRecordingList">
			<div class="info-subtitle">记录{{index+1}}</div>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					催收人：
					<label class="text">{{val.name}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					催收日期：
					<label class="text">{{val.date}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					催收结果：
					<label class="text">{{val.result}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row resultShrink">
				<el-col class="subtitle" :span="3">催收记录</el-col>
				<el-col :span="12" class="text-height text-height-shrink" :id="'doorRecording'+index">
					{{ val.desc }}
				</el-col>
				<el-col :span="3">
					<el-button class="credit-button-text" type="text" @click="$libs.changeHeight('doorRecording'+index, val)">{{ val.shrinkText}}</el-button>
				</el-col>
			</el-row>
		</div>
		<div class="title">拖车记录</div>
		<div v-for="(val , index) in trailer">
			<div class="info-subtitle">记录{{index+1}}</div>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					执行人：
					<label class="text">{{val.name}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					拖车日期：
					<label class="text">{{val.date}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					停放地：
					<label class="text">{{val.local}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					拖车费用：
					<label class="text">{{val.towingCost}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					停车费用：
					<label class="text">{{val.parkingCost}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					车架号：
					<label class="text">{{val.vin}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					发动机号：
					<label class="text">{{val.engineNo}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					取车日期：
					<label class="text">{{val.pickupDate}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					保管时间：
					<label class="text">{{val.saveTime}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row resultShrink">
				<el-col class="subtitle" :span="3">拖车记录</el-col>
				<el-col :span="12" class="text-height text-height-shrink" :id="'trailer'+index">
					{{ val.desc }}
				</el-col>
				<el-col :span="3">
					<el-button class="credit-button-text" type="text" @click="$libs.changeHeight('trailer'+index, val)">{{ val.shrinkText}}</el-button>
				</el-col>
			</el-row>
		</div>
		<div class="title">法院诉讼</div>
		<div v-for="(val , index) in lawsuitList">
			<div class="info-subtitle">记录{{index+1}}</div>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					函表交银行日期：
					<label class="text">{{val.tableToBankDate}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					银行办证日期：
					<label class="text">{{val.bankOfficeDate}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					法院受理日期：
					<label class="text">{{val.courtAcceptanceDate}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					执行法院：
					<label class="text">{{val.doCourt}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					立案日期：
					<label class="text">{{val.registerDate}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					立案法院：
					<label class="text">{{val.registerCourt}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					案号：
					<label class="text">{{val.code}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					诉讼标的：
					<label class="text">{{val.registerObject}}</label>
				</el-col>
				<el-col :span="8" class="info-label">
					诉讼费用：
					<label class="text">{{val.registerPrice}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row">
				<el-col :span="8" class="info-label">
					律师费：
					<label class="text">{{val.legelPrice}}</label>
				</el-col>
			</el-row>
			<el-row class="info-row resultShrink">
				<el-col class="subtitle" :span="3">催收记录</el-col>
				<el-col :span="12" class="text-height text-height-shrink" :id="'lawsuitList'+index">
					{{ val.remark }}
				</el-col>
				<el-col :span="3">
					<el-button class="credit-button-text" type="text" @click="$libs.changeHeight('lawsuitList'+index, val)">{{ val.shrinkText}}</el-button>
				</el-col>
			</el-row>
		</div>
	</div>
</template>
<script type="text/javascript">
export default {
	name: 'assetProtection',
	data() {
		return {
			// 电催记录
			electricRecordingList: [],
			// 上门催收记录
			doorRecordingList: [],
			// 拖车记录
			trailer: [],
			// 法院诉讼
			lawsuitList: []
		}
	},
	methods: {
		getInfo(_id, _cb, _cb2) {
			this.$http.get('/overdue/detail/order/' + _id).then((data) => {
				if (data.data.success) {
					let datas = data.data.data;
					if (_cb && (datas.callingDebtList && datas.callingDebtList.length == 0) && (datas.visitDebtList && datas.visitDebtList.length == 0) && (datas.towingHisList && datas.towingHisList.length == 0) && (datas.lawsuitHisList && datas.lawsuitHisList.length == 0)) {
						_cb();
					}
					// 电催记录
					this.electricRecordingList = [];
					$.each(datas.callingDebtList, (i, val) => {
						this.electricRecordingList.push({
							name: val.collectorStaffName, //催收人
							date: val.collectDate, //催收时间
							desc: val.remark, //催收记录
							shrink: false,
							shrinkText: '展开全部'
						});
					});

					// 上门催收记录
					this.doorRecordingList = [];
					$.each(datas.visitDebtList, (i, val) => {
						this.doorRecordingList.push({
							name: val.collectorStaffName, //催收人
							date: val.collectDate, //催收日期
							result: val.status, //催收结果
							desc: val.remark, //催收记录
							shrink: false,
							shrinkText: '展开全部'
						});
					});

					// 拖车记录
					this.trailer = [];
					$.each(datas.towingHisList, (i, val) => {
						this.trailer.push({
							name: val.execStaffName, //执行人
							local: val.location, //停放地
							date: val.towingDate, //拖车日期
							towingCost: val.towingCost, //拖车费用
							parkingCost: val.parkingCost, //停车费用
							engineNo: val.engineNo, //发动机号
							vin: val.vin, // 车架号
							pickupDate: val.pickupDate, //取车日期
							saveTime: val.towingDate ? Math.ceil((new Date(val.pickupDate).getTime() - new Date(val.towingDate).getTime()) / 24 / 60 / 60 / 1000) : '', //保管时间
							desc: val.towingRemark, //催收记录
							shrink: false,
							shrinkText: '展开全部'
						});
					});

					// 法院诉讼
					this.lawsuitList = [];
					$.each(datas.lawsuitHisList, (i, val) => {
						this.lawsuitList.push({
							tableToBankDate: val.indictmentSubmitDate, //函表交银行日期
							bankOfficeDate: val.registrateDate, //银行办证日期
							courtAcceptanceDate: val.courtAcceptDate, //法院受理日期
							doCourt: val.execCourt, //执行法院
							registerDate: val.filingDate, //立案日期
							registerCourt: val.filingCourt, //立案法院
							code: val.caseNo, //案号
							registerObject: val.lawsuitSubject, //诉讼标的
							registerPrice: val.lawsuitFee, //诉讼费用
							legelPrice: val.attorneyFee, //律师费
							remark: val.remark, //催收记录
							shrink: false,
							shrinkText: '展开全部'
						});

					});

				} else {
					if (_cb) {
						_cb();
					}
				}
			}).catch((error) => {

			});
		}
	},
	mounted() {

	}
}

</script>
<style lang="scss" scoped>
@import '../../assets/css/site.scss';
.assetProtection {
	font-size: 14px;
	color: #475669;
	padding-top: 17px;
}

</style>
